package com.minimalist.common.entity.lindi.po;

import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;
import com.mybatisflex.annotation.Table;

import java.io.Serial;
import java.io.Serializable;

/**
 * 林地指标交易平台_交易申请合同模板表 实体类。
 *
 * @author 11987
 * @since 2025-06-04
 */
@Table(value = "LINDI_TRADE_APPLICATION_TEMPLATE_CONTRACT", onInsert = InsertFullColumnHandler.class, onUpdate = UpdateFullColumnHandler.class)
public class LindiTradeApplicationTemplateContract extends BaseEntity implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 交易申请合同模板ID
     */
    private Long tradeApplicationContractFileId;

    /**
     * 交易申请ID
     */
    private Long tradeApplicationId;

    /**
     * 交易申请合同模板文件ID
     */
    private Long fileId;

    /**
     * 合同类型
     */
    private String contractType;

    /**
     * 状态
     */
    private Integer status;

    // 无参构造函数
    public LindiTradeApplicationTemplateContract() {
    }

    // 全参构造函数
    public LindiTradeApplicationTemplateContract(Long tradeApplicationContractFileId, Long tradeApplicationId, Long fileId, String contractType, Integer status) {
        this.tradeApplicationContractFileId = tradeApplicationContractFileId;
        this.tradeApplicationId = tradeApplicationId;
        this.fileId = fileId;
        this.contractType = contractType;
        this.status = status;
    }

    // Getter和Setter方法
    public Long getTradeApplicationContractFileId() {
        return tradeApplicationContractFileId;
    }

    public void setTradeApplicationContractFileId(Long tradeApplicationContractFileId) {
        this.tradeApplicationContractFileId = tradeApplicationContractFileId;
    }

    public Long getTradeApplicationId() {
        return tradeApplicationId;
    }

    public void setTradeApplicationId(Long tradeApplicationId) {
        this.tradeApplicationId = tradeApplicationId;
    }

    public Long getFileId() {
        return fileId;
    }

    public void setFileId(Long fileId) {
        this.fileId = fileId;
    }

    public String getContractType() {
        return contractType;
    }

    public void setContractType(String contractType) {
        this.contractType = contractType;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        LindiTradeApplicationTemplateContract that = (LindiTradeApplicationTemplateContract) o;
        return java.util.Objects.equals(tradeApplicationContractFileId, that.tradeApplicationContractFileId) &&
               java.util.Objects.equals(tradeApplicationId, that.tradeApplicationId) &&
               java.util.Objects.equals(fileId, that.fileId) &&
               java.util.Objects.equals(contractType, that.contractType) &&
               java.util.Objects.equals(status, that.status);
    }

    @Override
    public int hashCode() {
        return java.util.Objects.hash(super.hashCode(), tradeApplicationContractFileId, tradeApplicationId, fileId, contractType, status);
    }

    @Override
    public String toString() {
        return "LindiTradeApplicationTemplateContract{" +
               "tradeApplicationContractFileId=" + tradeApplicationContractFileId +
               ", tradeApplicationId=" + tradeApplicationId +
               ", fileId=" + fileId +
               ", contractType='" + contractType + '\'' +
               ", status=" + status +
               "} " + super.toString();
    }

    // Builder类
    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {
        private Long tradeApplicationContractFileId;
        private Long tradeApplicationId;
        private Long fileId;
        private String contractType;
        private Integer status;

        public Builder tradeApplicationContractFileId(Long tradeApplicationContractFileId) {
            this.tradeApplicationContractFileId = tradeApplicationContractFileId;
            return this;
        }

        public Builder tradeApplicationId(Long tradeApplicationId) {
            this.tradeApplicationId = tradeApplicationId;
            return this;
        }

        public Builder fileId(Long fileId) {
            this.fileId = fileId;
            return this;
        }

        public Builder contractType(String contractType) {
            this.contractType = contractType;
            return this;
        }

        public Builder status(Integer status) {
            this.status = status;
            return this;
        }

        public LindiTradeApplicationTemplateContract build() {
            return new LindiTradeApplicationTemplateContract(tradeApplicationContractFileId, tradeApplicationId, fileId, contractType, status);
        }
    }

}
